/**
 * 
 */
package org.gov.vis.master.gui;

import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.gov.vis.components.VISTextField;
import org.gov.vis.gui.VisBaseDialog;
import org.gov.vis.gui.util.GuiUtil;
import org.gov.vis.master.gui.listener.DepartmentListener;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
/**
 * @author user
 *
 */
public class DepartmentDialog extends VisBaseDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7641414263457788770L;
	private JPanel deptPanel;
	private JPanel msgPanel;
	private JButton btnReset;
	private JButton btnSave;
	private JPanel btnPanel;
	private VISTextField txtFldDistrict;
	private JLabel lblDistrict;
	private VISTextField txtFldManadal;
	private JLabel lblMandal;
	private VISTextField txtFldVillage;
	private JLabel lblVillage;
	private VISTextField txtFldNameOfInst;
	private JLabel lblNameOfInst;
	private VISTextField txtFldCode;
	private JLabel lblCode;

	/**
	 * @param owner
	 * @param title
	 * @param modal
	 */
	public DepartmentDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		initGUI();
		GuiUtil.CompCenterCords cords=GuiUtil.getCompCenterCords(500, 300);
		setBounds(cords.getX(), cords.getY(), 500, 300);
	}

	private void initGUI() {
		GridBagLayout thisLayout = new GridBagLayout();
		thisLayout.rowWeights = new double[] {0.1};
		thisLayout.rowHeights = new int[] {7};
		thisLayout.columnWeights = new double[] {0.1};
		thisLayout.columnWidths = new int[] {7};
		getContentPane().setLayout(thisLayout);
		{
			deptPanel = new JPanel();
			GridBagLayout deptPanelLayout = new GridBagLayout();
			deptPanelLayout.columnWidths = new int[] {7, 7, 7, 7, 7};
			deptPanelLayout.rowHeights = new int[] {7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7};
			deptPanelLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.1, 0.0};
			deptPanelLayout.rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
			getContentPane().add(deptPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
			deptPanel.setLayout(deptPanelLayout);
			{
				lblCode = new JLabel();
				deptPanel.add(lblCode, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblCode.setText(setFieldLabel(getResources().getString("dialog_label_dept_code"), true));
			}
			{
				txtFldCode = new VISTextField();
				deptPanel.add(txtFldCode, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblNameOfInst = new JLabel();
				deptPanel.add(lblNameOfInst, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 30, 0, 0), 0, 0));
				lblNameOfInst.setText(setFieldLabel(getResources().getString("dialog_label_dept_institution"), true));
			}
			{
				txtFldNameOfInst = new VISTextField();
				deptPanel.add(txtFldNameOfInst, new GridBagConstraints(3, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblVillage = new JLabel();
				deptPanel.add(lblVillage, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblVillage.setText(setFieldLabel(getResources().getString("dialog_label_dept_village"), false));
			}
			{
				txtFldVillage = new VISTextField();
				deptPanel.add(txtFldVillage, new GridBagConstraints(3, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblMandal = new JLabel();
				deptPanel.add(lblMandal, new GridBagConstraints(1, 8, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblMandal.setText(setFieldLabel(getResources().getString("dialog_label_dept_mandal"), false));
			}
			{
				txtFldManadal = new VISTextField();
				deptPanel.add(txtFldManadal, new GridBagConstraints(3, 8, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblDistrict = new JLabel();
				deptPanel.add(lblDistrict, new GridBagConstraints(1, 10, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblDistrict.setText(setFieldLabel(getResources().getString("dialog_label_dept_district"), false));
			}
			{
				txtFldDistrict = new VISTextField();
				deptPanel.add(txtFldDistrict, new GridBagConstraints(3, 10, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				{
					msgPanel = new JPanel();
					GridBagLayout jPanel1Layout = new GridBagLayout();
					deptPanel.add(msgPanel, new GridBagConstraints(1, 1, 3, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
					
					jPanel1Layout.rowWeights = new double[] {0.1};
					jPanel1Layout.rowHeights = new int[] {7};
					jPanel1Layout.columnWeights = new double[] {0.1};
					jPanel1Layout.columnWidths = new int[] {7};
					msgPanel.setLayout(jPanel1Layout);
				}
			}
			{
				btnPanel = new JPanel();
				deptPanel.add(btnPanel, new GridBagConstraints(3, 12, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				
				{
					btnSave = new JButton();
					btnPanel.add(btnSave);
					btnSave.setText("Save");
					btnSave.setPreferredSize(new java.awt.Dimension(80, 23));
					btnSave.addActionListener(new DepartmentListener(this));
				}
				{
					btnReset = new JButton();
					btnPanel.add(btnReset);
					btnReset.setText("Reset");
					btnReset.setPreferredSize(new java.awt.Dimension(80, 23));
					btnReset.addActionListener(new DepartmentListener(this));
				}
			}
		}

		this.setSize(500, 300);

		
	}

	public JPanel getjPanel1() {
		return msgPanel;
	}
	/**
	 * @return the deptPanel
	 */
	public JPanel getDeptPanel() {
		return deptPanel;
	}

	/**
	 * @param deptPanel the deptPanel to set
	 */
	public void setDeptPanel(JPanel deptPanel) {
		this.deptPanel = deptPanel;
	}

	/**
	 * @return the btnReset
	 */
	public JButton getBtnReset() {
		return btnReset;
	}

	/**
	 * @param btnReset the btnReset to set
	 */
	public void setBtnReset(JButton btnReset) {
		this.btnReset = btnReset;
	}

	/**
	 * @return the btnSave
	 */
	public JButton getBtnSave() {
		return btnSave;
	}

	/**
	 * @param btnSave the btnSave to set
	 */
	public void setBtnSave(JButton btnSave) {
		this.btnSave = btnSave;
	}

	/**
	 * @return the btnPanel
	 */
	public JPanel getBtnPanel() {
		return btnPanel;
	}

	/**
	 * @param btnPanel the btnPanel to set
	 */
	public void setBtnPanel(JPanel btnPanel) {
		this.btnPanel = btnPanel;
	}

	/**
	 * @return the txtFldDistrict
	 */
	public VISTextField getTxtFldDistrict() {
		return txtFldDistrict;
	}

	/**
	 * @param txtFldDistrict the txtFldDistrict to set
	 */
	public void setTxtFldDistrict(VISTextField txtFldDistrict) {
		this.txtFldDistrict = txtFldDistrict;
	}

	/**
	 * @return the lblDistrict
	 */
	public JLabel getLblDistrict() {
		return lblDistrict;
	}

	/**
	 * @param lblDistrict the lblDistrict to set
	 */
	public void setLblDistrict(JLabel lblDistrict) {
		this.lblDistrict = lblDistrict;
	}

	/**
	 * @return the txtFldManadal
	 */
	public VISTextField getTxtFldManadal() {
		return txtFldManadal;
	}

	/**
	 * @param txtFldManadal the txtFldManadal to set
	 */
	public void setTxtFldManadal(VISTextField txtFldManadal) {
		this.txtFldManadal = txtFldManadal;
	}

	/**
	 * @return the lblMandal
	 */
	public JLabel getLblMandal() {
		return lblMandal;
	}

	/**
	 * @param lblMandal the lblMandal to set
	 */
	public void setLblMandal(JLabel lblMandal) {
		this.lblMandal = lblMandal;
	}

	/**
	 * @return the txtFldVillage
	 */
	public VISTextField getTxtFldVillage() {
		return txtFldVillage;
	}

	/**
	 * @param txtFldVillage the txtFldVillage to set
	 */
	public void setTxtFldVillage(VISTextField txtFldVillage) {
		this.txtFldVillage = txtFldVillage;
	}

	/**
	 * @return the lblVillage
	 */
	public JLabel getLblVillage() {
		return lblVillage;
	}

	/**
	 * @param lblVillage the lblVillage to set
	 */
	public void setLblVillage(JLabel lblVillage) {
		this.lblVillage = lblVillage;
	}

	/**
	 * @return the txtFldNameOfInst
	 */
	public VISTextField getTxtFldNameOfInst() {
		return txtFldNameOfInst;
	}

	/**
	 * @param txtFldNameOfInst the txtFldNameOfInst to set
	 */
	public void setTxtFldNameOfInst(VISTextField txtFldNameOfInst) {
		this.txtFldNameOfInst = txtFldNameOfInst;
	}

	/**
	 * @return the lblNameOfInst
	 */
	public JLabel getLblNameOfInst() {
		return lblNameOfInst;
	}

	/**
	 * @param lblNameOfInst the lblNameOfInst to set
	 */
	public void setLblNameOfInst(JLabel lblNameOfInst) {
		this.lblNameOfInst = lblNameOfInst;
	}

	/**
	 * @return the txtFldCode
	 */
	public VISTextField getTxtFldCode() {
		return txtFldCode;
	}

	/**
	 * @param txtFldCode the txtFldCode to set
	 */
	public void setTxtFldCode(VISTextField txtFldCode) {
		this.txtFldCode = txtFldCode;
	}

	/**
	 * @return the lblCode
	 */
	public JLabel getLblCode() {
		return lblCode;
	}

	/**
	 * @param lblCode the lblCode to set
	 */
	public void setLblCode(JLabel lblCode) {
		this.lblCode = lblCode;
	}

	/**
	 * @return the msgPanel
	 */
	public JPanel getMsgPanel() {
		return msgPanel;
	}

	/**
	 * @param msgPanel the msgPanel to set
	 */
	public void setMsgPanel(JPanel msgPanel) {
		this.msgPanel = msgPanel;
	}

}
